<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

    <style>
        *{
            margin: 0;
            padding: 0;
            border: 0;
        }
        nav{
            width: 70%;
            margin: 0 auto;
        }
        nav>ul{
            width: 100%;
            list-style: none;
        }
        nav>ul>li{
            text-align: center;
            width: 10%;
            float: left;
            height: 30px;
            line-height: 30px;
            margin: 20px;
            background-color: red;
        }
        nav>ul>li>ul{
            display: none;
            list-style: none;
        }
    </style>
</head>
<body>
<nav>
    <ul>
        <li>
            菜单一
            <ul>
                <li>菜单一儿子1</li>
                <li>菜单一儿子2</li>
                <li>菜单一儿子3</li>
            </ul>
        </li>

        <li>
            菜单二
            <ul>
                <li>菜单二儿子1</li>
                <li>菜单二儿子2</li>
                <li>菜单二儿子3</li>
            </ul>
        </li>

        <li>
            菜单三
            <ul>
                <li>菜单三儿子1</li>
                <li>菜单三儿子2</li>
                <li>菜单三儿子3</li>
            </ul>
        </li>
    </ul>
</nav>

<script src="jquery-3.1.1.min.js"></script>

<script>
    $(function () {
        //获取一级菜单li

        $("nav>ul>li").mouseenter(function () {
            console.log(this)
            $(this).children("ul").css("display","block")
        })

        $("nav>ul>li").mouseleave(function () {
            $(this).children("ul").hide()
        })
    })
</script>
</body>
</html>